package item;

import loadsave.Memento;
import loadsave.loadsaveobject.LoadSaveObject;
import inventory.EquipLocation;
import visitors.TakeableItemVisitor;

public class NonWeapon extends EquipableItem {

	public NonWeapon( String name, EquipLocation location, String activeSkillName ) {
        super(name);
        setEquipLocation(location);
        setActiveSkillName(activeSkillName);
    }
	
    /**
     * have the visitor visit this item to pick it up
     */
	public void accept(TakeableItemVisitor visitor) {
		visitor.visitNonWeapon(this);
	}
	
   @Override
    public Memento getMemento() {
        return new Memento() {

            @Override
            public LoadSaveObject getState() {
                LoadSaveObject lso = NonWeapon.super.getMemento().getState();
                lso.setType("NonWeapon");
                return lso;
            }

            @Override
            public void restoreState(LoadSaveObject lso) {
                NonWeapon.super.getMemento().restoreState(lso);
            }
            
        };
    }

	public NonWeapon() { }
    
	@Override
	public NonWeapon clone() {
		NonWeapon toReturn = new NonWeapon();
		toReturn.getMemento().restoreState(this.getMemento().getState());
		return toReturn;
	}

}
